package com.towker.frame.service;

import java.util.List;
import org.springframework.stereotype.Controller;

import com.towker.frame.dao.rbac.SubsystemDao;
import com.towker.frame.model.rbac.Subsystem;
import com.towker.frame.share.ServiceShare;


@Controller
public class MainService
{
	private SubsystemDao dao;
	public void setSubsystemDao(SubsystemDao dao)
	{
		this.dao = dao;
	}
	
	/**
	 * 根据用户编号，获得该用户的所有子系统。	 * */
	public List<Subsystem> getSysByUserid(long userid)
	{
		return dao.getSysByUserid(userid);
	}

	/**
	 * 根据系统ID获得系统。	 */
	public Subsystem getSysById(long id)
	{
		return (Subsystem) dao.getById(id);
	}

	public static void main(String[] args) throws Exception
	{
		MainService mm=(MainService)ServiceShare.getService(MainService.class);
		System.out.println(mm.getSysByUserid(1).size());
	}
}
